home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / Bowers Development / AppMaker 2.0b5 / Examples / Procedural / Gadgets / AboutDialog.c next >
Encoding:
C/C++ Source or Header  |  1996-03-19  |  1.3 KB  |  62 lines  |  [TEXT/MMCC]

  1. /* AboutDialog.c -- Modal dialog */
  2. /* Created 01/01/95 12:01 PM by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Lists.h>
  10. #include <Menus.h>
  11. #include <TextEdit.h>
  12. #include "ResourceDefs.h"
  13. #include "Miscellany.h"
  14. #include "DialogAids.h"
  15. #include "WindowAids.h"
  16. #include "AboutDialog.h"
  17.  
  18. #define OKButton        1
  19. #define AboutLabel        2
  20.  
  21.  
  22. /*----------*/
  23. Boolean GetAboutDialog (AboutDialogRec    *AboutDialog)
  24. {
  25.     DialogPtr        theDialog;
  26.     GrafPtr            savePort;
  27.     Boolean            result;
  28.     Boolean            done;
  29.     short            itemNr;
  30.     register AboutDialogRecPtr    info;
  31.     ModalFilterUPP    FilterAboutDialogUPP;
  32.  
  33.     GetPort (&savePort);
  34.     InitCursor ();
  35.     theDialog = GetNewDialog (DLOG_AboutDialog, nil, (WindowPtr) -1L);
  36.     SetPort (theDialog);
  37.     info = AboutDialog;
  38.     FilterAboutDialogUPP = NewModalFilterProc (StandardFilter);
  39.  
  40.     ShowWindow (theDialog);
  41.     OutlineButton (1);
  42.     done = false;
  43.     while (!done) {
  44.  
  45.         MovableDialog (FilterAboutDialogUPP, &itemNr);
  46.         switch (itemNr) {
  47.             case OKButton:
  48.                     result = true;
  49.                     done = true;
  50.                 break;
  51.  
  52.         } /* switch */
  53.     } /* while */
  54.     DisposeRoutineDescriptor ((UniversalProcPtr) FilterAboutDialogUPP);
  55.  
  56.     DisposDialog (theDialog);
  57.     SetPort (savePort);
  58.     return (result);
  59. } /*GetAboutDialog*/
  60.  
  61. /* AboutDialog */
  62.